package com.pictures.mapper;

import com.pictures.pojo.Favourite;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface FavouriteMapper {

    //查找所有点赞
    List<Favourite> getFavourites();

    //根据ID查找点赞
    Favourite getFavouriteById(@Param("id") Long id);

    //根据用户ID查找点赞
    Favourite getFavouriteByUserId(@Param("uid") Long uid);

    //根据内容ID查找点赞
    Favourite getFavouriteByContentId(@Param("cid") Long cid);

    //根据用户ID和内容ID取删除点赞
    //取消点赞 map.put("u_id",1); map.put("c_id",2);
    Favourite deleteFavouriteByUserIdAndContentId(Map<String,Object> map);


}
